package com.bfmet.news;

import java.util.List;

import javax.faces.bean.ManagedBean;

import com.bfmet.common.Parameter;
import com.bfmet.common.base.DAOWrapper;
import com.bfmet.entity.News;

@ManagedBean
public class NewsAction extends DAOWrapper {

	public News getOneNews() {
		return getOneResult(News.class, getRequestParam().get("id"));
	}

	public List<News> getNewsList() {
		return query(News.class, 15, new Parameter("type", News.Type.NEWS));
	}

	public List<News> getPolicies() {
		return query(News.class, 6, new Parameter("type", News.Type.POLICY));
	}

	public List<News> getIndusties() {
		return query(News.class, 6, new Parameter("type", News.Type.INDUSTRY));
	}

	public List<News> getHots() {
		return query(News.class, 4, new Parameter("type", News.Type.HOT));
	}
}
